package hlhj.fhp.checkpoint.fgms

import android.content.Intent
import com.example.mymvp.mvp.BaseFgm
import hlhj.fhp.checkpoint.R
import hlhj.fhp.checkpoint.atys.OrderAty
import hlhj.fhp.checkpoint.iview.HomeOrderView
import hlhj.fhp.checkpoint.presenter.HomeOrderPresenter
import kotlinx.android.synthetic.main.fgm_order.view.*

/**
 * Created by Never Fear   on 2018\11\7 0007.
Never More....
 */
class HomeOrderFgm :BaseFgm<HomeOrderView,HomeOrderPresenter>(), HomeOrderView {
    override fun initView() {
    }

    override fun logicStart() {

    }
    override fun setListener() {
        rootView.btCheckViolation.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",1)//违章
            startActivity(intent)
        }
        rootView.btYearOrder.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",2)//年检
            startActivity(intent)
        }
        rootView.btViolationUn.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",1)//违章
            intent.putExtra("tag",1)
            startActivity(intent)
        }
        rootView.btViolationAlready.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",1)//违章
            intent.putExtra("tag",2)
            startActivity(intent)
        }
        rootView.btViolationDoing.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",1)//违章
            intent.putExtra("tag",3)
            startActivity(intent)
        }
        rootView.btViolationDone.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",1)//违章
            intent.putExtra("tag",4)
            startActivity(intent)
        }
        rootView.btYearUn.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",2)//年检
            intent.putExtra("tag",1)
            startActivity(intent)
        }
        rootView.btYearDoing.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",2)//年检
            intent.putExtra("tag",2)
            startActivity(intent)
        }
        rootView.btYearUndo.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",2)//年检
            intent.putExtra("tag",3)
            startActivity(intent)
        }
        rootView.btYearDone.setOnClickListener {
            val intent = Intent(context, OrderAty::class.java)
            intent.putExtra("type",2)//年检
            intent.putExtra("tag",4)
            startActivity(intent)
        }
    }

    override fun bindView(): HomeOrderView {
        return this
    }

    override fun createPresenter(): HomeOrderPresenter {
        return HomeOrderPresenter()
    }

    override fun doBeforInit() {
    }

    override fun getContentId(): Int {
        return R.layout.fgm_order
    }
}